package com.ruicar.afs.cloud.afscase.common.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.afscase.common.dto.ProductInfoDTO;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * @description: 请求产品服务
 * @author: sijun.yu
 * @date: 2020/6/4 9:11
 */
@FeignClient(name = "FinanceProduct", url = "${com.greatwall.services.product-service.url}")
public interface FinanceProductFeign {

    /**
     * 查询产品详情
     *
     * @param productInfoDTO
     * @param headers
     * @return
     */
    @ApiOperation("查询产品详情")
    @PostMapping(value = "/productPlan/getProductDetails")
    IResponse<JSONObject> queryProductDetails(@RequestBody ProductInfoDTO productInfoDTO, @RequestHeader Map<String, String> headers);

    /**
     * 产品信息校验
     *
     * @return
     */
    @ApiOperation("产品信息校验")
    @PostMapping(value = "/productPlan/checkProductInfo")
    IResponse checkProductInfo(@RequestBody ProductInfoDTO productInfoDTO, @RequestHeader Map<String, String> headers);

    /**
     * 风控准入校验
     *
     * @param productInfoDTO
     * @param headers
     * @return
     */
    @ApiOperation("风控准入校验")
    @PostMapping(value = "/productPlan/chenkRiskInfo")
    IResponse chenkRiskInfo(@RequestBody ProductInfoDTO productInfoDTO, @RequestHeader Map<String, String> headers);

    /**
     * 查询产品利率
     *
     * @param productInfoDTO
     * @param headers
     * @return
     */
    @ApiOperation("查询产品利率")
    @PostMapping(value = "/productPlan/getcustomerrate")
    IResponse getCustomerRate(@RequestBody ProductInfoDTO productInfoDTO, @RequestHeader Map<String, String> headers);

}
